﻿#pragma once

#include "Camera.h"

#include "core/Macro.h"

#include "function/EventSystem/ApplicationEvent.h"
#include "function/EventSystem/Event.h"
#include "function/EventSystem/MouseEvent.h"

namespace Engine
{
	class ENGINE_API CameraController
	{
	public:
		explicit CameraController(float aspectRatio);

		void OnUpdate(float deltaTime);
		void OnEvent(Event& event);

		[[nodiscard]] const Camera& GetCamera() const { return camera; }
		Camera& GetCamera() { return camera; }

	private:
		bool OnMouseScrolled(const MouseScrolledEvent& event);
		bool OnWindowResized(const WindowResizeEvent& event);

		Camera camera;

		float aspectRatio;
		float zoomLevel = 1.0f;

		glm::vec3 cameraPosition = {0.0f, 0.0f, 0.0f};
		float cameraRotation = 0.0f;
		float cameraMoveSpeed = 0.01f;
		float cameraRotationSpeed = 1.0f;
	};
}
